package cn.edu.nwpu.warehousemanagement.config;

//import org.springdoc.core.customizers.GlobalOpenApiCustomizer;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * swagger
 *
 * @author Loadstar
 * @version 1.0
 */
@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI swaggerOpenAPI() {
        return new OpenAPI()
                .info(new Info().title("WarehouseManagementAPI文档")
                        // 信息
                        .contact(new Contact().name("loadstar").email("loadstar@mail.nwpu.edu.cn").url("地址"))
                        // 简介
                        .description("WarehouseManagementAPI文档，描述了Entity和Controller")
                        // 版本
                        .version("v1")
                        // 许可证
                        .license(new License().name("Apache 2.0").url("http://springdoc.org")))
                .externalDocs(new ExternalDocumentation()
                        .description("gitee仓库")
                        .url("https://gitee.com/Loadstar_QYZ/warehouse-management"));
    }

}
